package de.baumann.browser.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import de.baumann.browser.OdinGlideModule
import de.baumann.browser.R
import de.baumann.browser.api.net.vo.duobao.CYJL
import de.baumann.browser.utils.StringUtil

class CYJLAdapter : BaseQuickAdapter<CYJL, BaseViewHolder>(R.layout.item_canyu) {
    override fun convert(helper: BaseViewHolder, item: CYJL) {
        helper.setText(R.id.canyuName, item.userName)
        helper.setText(R.id.canyuTime, item.createTime)
        helper.setText(R.id.cydz, StringUtil.StrReplace(item.address))
        helper.setText(R.id.canyuFene, "参与${item.participationNum}份")
        val canyuHead:ImageView = helper.getView(R.id.canyuHead)
        OdinGlideModule.loadWithCropAndCircle(mContext,item.avatar,canyuHead,R.drawable.icon_head)
    }
}